#!/usr/bin/python
# -*- encoding: utf-8 -*-
'''
@File    :   4.py
@Time    :   2020/05/26 19:45:08
@Author  :   Malygos_l 
@Version :   1.0
@Contact :   751756061@qq.com
@WebSite :   www.gitee.com/malygos_l
'''
# Start typing your code from here
'''
封装一个学生类，有姓名，有年龄，有性别，
有英语成绩，数学成绩，语文成绩，
封装方法，求单个学生的总分，平均分，以及打印学生的信息。
'''


class Student:
    def __init__(self, name, age, sex, Chinese_score, math_score,
                 English_score):
        self.__name = name
        self.__age = age
        self.__sex = sex
        self.__English_score = English_score
        self.__math_score = math_score
        self.__Chinese_score = Chinese_score

    def __get_sum(self, English_score, math_score, Chinese_score):
        sum = English_score + math_score + Chinese_score
        print("该学生总分是：%d" % sum)

    def __get_average(self, English_score, math_score, Chinese_score):
        average = (English_score + math_score + Chinese_score) / 3
        print("该学生平均分是：%d" % average)

    def __print_info(self):
        print("\n---------打印学生信息---------\n")
        print('姓名：%s\t年龄：%d\t性别：%s\t\n语数英成绩分别为：%d %d %d' %
              (self.__name, self.__age, self.__sex, self.__Chinese_score,
               self.__math_score, self.__English_score))

    def withdraw(self):
        self.__get_sum(self.__English_score, self.__math_score,
                       self.__Chinese_score)
        self.__get_average(self.__English_score, self.__math_score,
                           self.__Chinese_score)
        self.__print_info()


def main():
    student = Student('malygos ', 20, 'male', 90, 92, 92)
    student.withdraw()


if __name__ == "__main__":
    main()